/**
 * Created by cz on 2017/5/3.
 */
import React,{Component} from "react";
import {
    View,
    Image,
    Text,
    StyleSheet,
    Navigator
}from "react-native";
import Girl from "./Girl"
export default class Boy extends Component{
    constructor(props){
        super(props);
        this.state={
            word:""
        }
    }
    render(){
        return (
            <View style={styles.container}>
                <Text style={styles.text}>I am boy</Text>
                <Text onPress={()=>{
                    this.props.navigator.push({
                        component:Girl,
                        params:{
                             word:'一只玫瑰',
                             onCallBack:(word)=>{
                                this.setState({
                                    word:word
                                })
                             }
                        }
                    })
                }}>送女孩一只玫瑰</Text>
                <Text style={styles.text}>{this.state.word}</Text>
            </View>
        )
    }
}
const styles = StyleSheet.create({
    container:{
        flex:1,
        backgroundColor:"gray",
        justifyContent:"center"
    },
    text:{
        fontSize:20
    }
});